<?
/*********************************************
 *企业简介
 * *******************************************/
function smarty_function_qishi_jobs_show($params, &$smarty)
{
	extract($params);
	global $db,$timestamp;
	$id = (NULL != $id) ? $id : 0;
	$listname = (NULL != $listname) ? $listname : 'list'; //默认的section名称
	if (intval($id)!=$id) return false;
	$sql = "select * from ".table('jobs')." WHERE display='1' AND audit='1'  AND id=".$id;
	$val=$db->getone($sql);
	if ($val){
		$profile=get_company_profile($val['uid']);//企业介绍
		$jobsnature=get_jobs_nature_one($val['nature']);//职位性质
		$wage=get_jobs_wage_one($val['wage']);//月薪
		$district=get_jobs_area_one($val['district']);//工作地区
		$education=get_jobs_education_one($val['education']);//学历要求
		$experience=get_jobs_experience_one($val['experience']);//工作经验
//		$contact=get_jobs_contact($val['id']);//职位联系方式
//		$description=get_jobs_contents($val['id']);//职位描述
		$val['jobsnature']=$jobsnature['categoryname'];
//		p($profile);
		$val['wage']=$wage['categoryname'];
		$val['district']=$district['categoryname'];
		$val['education']=$education['categoryname'];
		$val['experience']=$experience?$experience['categoryname']:'不限';
		$val['education']=$education?$education['categoryname']:'不限';
		$val['contact']=$contact['contact'];
//		$val['telephone']=$contact['telephone'];
		$val['address']=$contact['address'];
		$val['email']=$contact['email'];
//		$val['qq']=$contact['qq'];
		$val['refreshtime']=date("Y-m-d H:i:s",$val['refreshtime']);
		$val['deadline']=date("Y-m-d H:i:s",$val['deadline']);
		$val['description']=$description;
		//----所属企业，企业介绍
		$trade=get_jobs_trade_one($profile['trade']);//获取行业
		$scale=get_jobs_scale_one($profile['scale']);//公司规模
		$area=get_jobs_area_one($profile['area']);//所在地区
		$nature=get_jobs_corporation_one($profile['nature']);//企业性质
		$val['company_id']=$profile['id'];
		$val['company_uid']=$val['uid'];
		$val['company_url']=url_rewrite('company',array('id0'=>$profile['id']));
		$val['companyname']=$profile['company_name_cn']?$profile['company_name_cn']:$profile['company_name_en'];
		$val['map']=$profile['map_open'];
		$val['trade']=$trade['categoryname'];
		$val['scale']=$scale['categoryname'];
		$val['nature']=$nature['categoryname'];
		$val['area']=$area['categoryname'];
		$val['registered']=$profile['registered'];
		$val['currency']=$profile['currency'];
	}
	$smarty->assign($listname, $val);
	unset($val);
}
?>